-
Notifications
You must be signed in to change notification settings - Fork 38.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Federation: separate notion of zone-name & dns-suffix #35372
Federation: separate notion of zone-name & dns-suffix #35372
Conversation
This is splitting #34901 into logical parts. I haven't found a test that covers the generated DNS names yet, but I expect e2e will find it for me :-) |
19cb087
to
2f7ea65
Compare
Now with unit test :-) |
ping @quinton-hoole / @madhusudancs |
@@ -39,6 +39,8 @@ type ControllerManagerConfiguration struct { | |||
FederationName string `json:"federationName"` | |||
// zone name, like example.com. | |||
ZoneName string `json:"zoneName"` | |||
// suffix to use for publishing federated services. | |||
FederationDnsSuffix string `json:"federationDnsSuffix"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It's a suffix to the service name, but a prefix to the DNS zone. Somewhat confusing, perhaps. I'd suggest either adding an example to clarify, or renaming it something like DNSSubZone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about ServiceDnsSuffix? I think that is unambiguous?
(DNSSubZone ambiguity: I'm not sure if that would include ZoneName)
@@ -101,6 +103,7 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) { | |||
fs.Var(componentconfig.IPVar{Val: &s.Address}, "address", "The IP address to serve on (set to 0.0.0.0 for all interfaces)") | |||
fs.StringVar(&s.FederationName, "federation-name", s.FederationName, "Federation name.") | |||
fs.StringVar(&s.ZoneName, "zone-name", s.ZoneName, "Zone name, like example.com.") | |||
fs.StringVar(&s.FederationDnsSuffix, "federation-dns-suffix", s.FederationDnsSuffix, "DNS Suffix to use for federation domain names.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per above comment
func getDnsZone(dnsZoneName string, dnsZonesInterface dnsprovider.Zones) (dnsprovider.Zone, error) { | ||
dnsZones, err := dnsZonesInterface.List() | ||
// getDnsZone returns the zone, as identified by zoneName | ||
func (s *ServiceController) getDnsZone() (dnsprovider.Zone, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like making this is member function of ServiceController. It has nothing to do with service controllers. If anything it should be a member of DNSZone, or a util function. Can we revert the function signature back to what it was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure... it's because in the next PR we'll add ID as well, but we can look at that when we come to it. I agree with you; it's not clear that even when we add ID is should be on ServiceController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM barring minor nits. Feel free to apply the label once done.
2f7ea65
to
7828249
Compare
Applied the changes & fixed, but I don't want to apply lgtm until we figure out the right name for the dns suffix flag, because it's really hard to change later (and so easy to change now!) Right now we have |
7828249
to
cb3269e
Compare
Jenkins verification failed for commit cb3269e9b8d26a80af950059e154daed109237c7. Full PR test history. The magic incantation to run this job again is |
We can put subdomains into hosted zones (for example, foo.federation.example.com can be hosted in example.com) By allowing sharing a common hosted zone, this means the user doesn't have to do as much setup.
cb3269e
to
a3ba760
Compare
Thanks @quinton-hoole . #34901 is the "big picture", but once this merges I'll split out the next piece which is to enable zone selection by id or name. I've assigned it to myself for now. The third piece is to batch updates, which I think is useful, but just "icing on the cake". I guess we'll see where we are once after PR 2/3. I'll also see if we're hitting the delays - if so it might be more important. |
Manually removing do-not-merge. I think merge bot added it because of the lack of the label, but then deleted its comment but not the label :-( |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
We can put subdomains into hosted zones (for example,
foo.federation.example.com can be hosted in example.com)
By allowing sharing a common hosted zone, this means the user doesn't
have to do as much setup.
This change is